package com.hbnu.controller;

import com.hbnu.service.ItemService;
import com.hbnu.vo.EasyUITable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/item")
public class ItemController {

    @Autowired
    private ItemService itemService;

    /*
     * 需求：查询所有的商品数据
     * 请求地址：http://localhost:8080/item/query?page=1&rows=20
     *响应数据格式：对象{整型的total，集合类型的rows}
     * */
    @GetMapping("/query")
    public EasyUITable queryItem(Integer page, Integer rows){

        return itemService.queryItem(page,rows);
    }
}
